package com.syp.auth.export.resource;

import static javax.ws.rs.core.MediaType.APPLICATION_JSON;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import com.syp.auth.domain.ProcessResult;
import com.syp.auth.export.common.GeneralUserVo;
import com.syp.auth.export.dto.request.TokenVerifyRequest;
import com.syp.auth.export.dto.response.TokenVerifyResponse;

@Path("/api/authorize")
public interface AuthorizeResourceI {

	/**
	 * 验证token的有效性
	 * @param request
	 * @return
	 */
	@Produces(APPLICATION_JSON)
	@Consumes(APPLICATION_JSON)
	@POST
	@Path("/verify")
	public TokenVerifyResponse verify(TokenVerifyRequest request);

	/**
	 * 退出登录接口
	 * @param sid
	 * @return
	 */
	@Produces(APPLICATION_JSON)
	@GET
	@Path("/signout")
	public ProcessResult signout(@QueryParam("sid") String sid);

	/**
	 * 获取当前登录用户
	 * @param sid
	 * @return
	 */
	@Produces(APPLICATION_JSON)
	@GET
	@Path("/cuser")
	public GeneralUserVo cuser(@QueryParam("sid") String sid);

}
